function  Estimates_tables(param_est,fp)

cd(fp.paper)    

%%%%%%%%%%%%%%%%%%%%%;
%Store the Bootstrap Distributon of Parameters;
%%%%%%%%%%%%%%%%%%%%%;

param_con_est_boot(:,1) = exp(fp.param_est_boot(:,1)./100);    %Children's skills (alpha1);
param_con_est_boot(:,2) = exp(fp.param_est_boot(:,2)./100);    %Peers' Skills (alpha2);
param_con_est_boot(:,3) = exp(fp.param_est_boot(:,3)./100);    %Investments (alpha3);
param_con_est_boot(:,4) = fp.param_est_boot(:,4)./100;         %Parenting Style (alpha0);

%Technology (CES, PS=0);
param_con_est_boot(:,5) = exp(fp.param_est_boot(:,5)./100)./(1 + exp(fp.param_est_boot(:,5)./100) );         %CES Elasticity (   Parents vs Peers, inner)
param_con_est_boot(:,6) = exp(fp.param_est_boot(:,6)./100)./(1 + exp(fp.param_est_boot(:,6)./100) );         %CES Share Skills ;
param_con_est_boot(:,7) = exp(fp.param_est_boot(:,7)./100)./(1 + exp(fp.param_est_boot(:,7)./100) );         %CES Share Peers;
param_con_est_boot(:,8) = -exp(fp.param_est_boot(:,8)./100) ;                                     %CES Elasticity ( Skills vs Parents-Peers, outer);
param_con_est_boot(:,9) = fp.param_est_boot(:,9)./100 ;                                           %Return to Scale CES;

%TFP
param_con_est_boot(:,10) = fp.param_est_boot(:,10)./100;           %TFP constant;
param_con_est_boot(:,11) = fp.param_est_boot(:,11)./100;           %TFP trend;

ind  = 11 ;

%Parent's Preferences;

param_con_est_boot(:,ind+1) =      exp(fp.param_est_boot(:,ind+1)./100);                    %Weight on Children's Skills;
param_con_est_boot(:,ind+2) =      fp.param_est_boot(:,ind+2)./100 ;                        %Disutility of PS;
param_con_est_boot(:,ind+3) =      fp.param_est_boot(:,ind+3)./100 ;                        %Heterogeneity in PS;

ind  = ind + 3 ;

%Child's Preferences;

param_con_est_boot(:,ind+1) =  fp.param_est_boot(:,ind+1)./100;                       %Constant (gamma0);
param_con_est_boot(:,ind+2) =  fp.param_est_boot(:,ind+2)./100;                       %Own Skills (gamma1);
param_con_est_boot(:,ind+3) =  fp.param_est_boot(:,ind+3)./100;                       %Child j 's Skills (gamma2);
param_con_est_boot(:,ind+4) =  fp.param_est_boot(:,ind+4)./100;                       %Homophily (gamm3);
param_con_est_boot(:,ind+5) =  fp.param_est_boot(:,ind+5)./100;                       %PS effect (gamma4);
param_con_est_boot(:,ind+6) =  fp.param_est_boot(:,ind+6)./100 ;                      %Disutility of PS (by Neighborhood income);

sd_param_est = std(param_con_est_boot,0,1);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%;
%Technology;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%;

label_param{1}=uint16('Child`s Skills ($\alpha_{1,1}$)');
label_param{2}=uint16('Peers Skills ($\alpha_{2,1}$)');
label_param{3}=uint16('Investments ($\alpha_{3,1}$)'); 


label_param{4}=uint16('Complementarity Parents vs. Peers ($\alpha_{3,0}$)'); 
label_param{5}=uint16('Share Self-Production ($\alpha_{1,0}$)');
label_param{6}=uint16('Share Peers Skills ($\alpha_{2,0}$)'); 
label_param{7}=uint16('Complementarity Self-Production vs. Parents-Peers ($\alpha_{4,0}$)');
label_param{8}=uint16('CES Return to Scale ($\alpha_{5,0}$)');


label_param{9}=uint16('TFP Contant ($\psi_{0}$)'); 
label_param{10}=uint16('TFP Age Trend ($\psi_{1}$)'); 
label_param{11}=uint16('TFP Parenting Style ($\psi_{2}$)');  


FID = fopen('Table_Est1.tex', 'w');
fprintf(FID, '\\begin{tabular}{lc}\\hline \\hline \\\\  \n');
fprintf(FID, ' & \\multicolumn{1}{c}{ Cobb-Douglas (Authoritarian = 1)} \\\\ \\cline{2-2} \\\\  \n');

ind_label = 1;
    
for i = [1 2 3 ]
    
    fprintf(FID, '%s & %2.3f   \\\\[-0.1cm] \n', ...
        char(label_param{ind_label}),  param_est(i)  ); 
    fprintf(FID, '%s & (%2.4f)   \\\\[0.3cm] \n', ...
        '',  sd_param_est(i)  );        

    ind_label = ind_label + 1;
    
end

fprintf(FID, ' & \\multicolumn{1}{c}{ CES (Authoritarian = 0)} \\\\ \\cline{2-2} \\\\  \n');


for i = 5:9 

    fprintf(FID, '%s & %2.3f   \\\\[-0.1cm] \n', ...
        char(label_param{ind_label}),  param_est(i)  ); 
    fprintf(FID, '%s & (%2.4f)   \\\\[0.3cm] \n', ...
        '',  sd_param_est(i)  ); 

    ind_label = ind_label + 1;    
        
end

fprintf(FID, ' & \\multicolumn{1}{c}{Total Factor Productivity} \\\\ \\cline{2-2} \\\\  \n');


for i = [10:11 4]
    
    fprintf(FID, '%s & %2.3f   \\\\[-0.1cm] \n', ...
        char(label_param{ind_label}),  param_est(i)  ); 
    fprintf(FID, '%s & (%2.4f)   \\\\[0.3cm] \n', ...
        '',  sd_param_est(i)  ); 

    ind_label = ind_label + 1;    
    
end
    
fprintf(FID, '  \\hline \\hline \n');
fprintf(FID, '\\end{tabular}\n');
fclose(FID);


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%;
%Parents Preferences;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%;

label_param_pp{1}=uint16('Child''s Skills ($\delta_{3}$)'); 
label_param_pp{2}=uint16('Disutility of Investment ($\delta_{1}$)'); 
label_param_pp{4}=uint16('Authoritarian X Child''s Skills ($\delta_{4}$)'); 

FID = fopen('Table_Est2.tex', 'w');
fprintf(FID, '\\begin{tabular}{lc}\\hline \\hline \\\\  \n');

fprintf(FID, '%s & %s      \\\\[-0.1cm] \n', char(label_param_pp{2}),  "\shortstack{1 \\ (Normalized)}" ); 
fprintf(FID, '%s & %s   \\\\[0.3cm] \n', '',  '(-)'  ); 
fprintf(FID, '%s & %2.3f   \\\\[-0.1cm] \n',  "Disutility of Authoritarian: Intercept ($\delta_{2,0}$)",   -param_est(13) ); 
fprintf(FID, '%s & (%2.4f)   \\\\[0.5cm] \n', '',  sd_param_est(13)  ); 
fprintf(FID, '%s & %2.3f   \\\\[-0.1cm] \n',  "Disutility of Authoritarian: Heterogeneity by Neighborhood Income ($\delta_{2,1}$)",   -param_est(20)  ); 
fprintf(FID, '%s & (%2.4f)   \\\\[0.5cm] \n', '',  sd_param_est(20)  ); 
fprintf(FID, '%s & %2.3f   \\\\[-0.1cm] \n', char(label_param_pp{1}),   param_est(12)  ); 
fprintf(FID, '%s & (%2.4f)   \\\\[0.5cm] \n', '',  sd_param_est(12)  ); 
fprintf(FID, '%s & %2.3f   \\\\[-0.1cm] \n', char(label_param_pp{4}),  -param_est(14)  ); 
fprintf(FID, '%s & (%2.4f)   \\\\[0.5cm] \n', '',  sd_param_est(14)  ); 
fprintf(FID, '  \\hline \\hline \n');
fprintf(FID, '\\end{tabular}\n');
fclose(FID);


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%;
%Children Preferences;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%;

label_param_cp{1}=uint16('Child $i$ ''s Skills ($\gamma_{1}$)'); 
label_param_cp{2}=uint16('Child $j$ ''s Skills ($\gamma_{2}$)'); 
label_param_cp{3}=uint16('Homophily ($\gamma_{3}$)'); 
label_param_cp{4}=uint16('Authoritarian ($\gamma_{4}$)');
label_param_cp{5}=uint16('Constant ($\gamma_{0}$)'); 


FID = fopen('Table_Est3.tex', 'w');
fprintf(FID, '\\begin{tabular}{lc}\\hline \\hline \\\\  \n');

ind_label = 1;

for i = [16 17 18 19 15 ]
fprintf(FID, '%s & %2.3f   \\\\[-0.1cm] \n', char(label_param_cp{ind_label}),  param_est(i)  ); 
fprintf(FID, '%s & (%2.4f)   \\\\[0.5cm] \n', '',  sd_param_est(i)  ); 
ind_label = ind_label + 1;
end
fprintf(FID, '  \\hline \\hline \n');
fprintf(FID, '\\end{tabular}\n');
fclose(FID);


%%%%%%%%%%%%%%%%%%%%%%%%%%%;
%Initial Conditions;
%%%%%%%%%%%%%%%%%%%%%%%%%%%;

for j = 1:1:4

    temp_mean_param_boot = [];
    temp_sd_param_boot = [];

for b=1:100        
    cd(fp.boot_dir)
    %load bootstrapped distribution of initial conditions;
    initial_conditions_boot          = importdata(sprintf('initial_conditions_boot%d.txt',b));    
    cd(fp.paper)    
    temp_mean_param_boot = [temp_mean_param_boot ; initial_conditions_boot(j,1)];
    temp_sd_param_boot = [temp_sd_param_boot ; initial_conditions_boot(j,2)];
end

schools_distrib_se(j,1) = std(temp_mean_param_boot);
schools_distrib_se(j,2) = std(temp_sd_param_boot);

end

schools_distrib= fp.schools_distrib;

FID = fopen('Table_Est4.tex', 'w');
fprintf(FID, '\\begin{tabular}{lccc}\\hline \\hline \\\\  \n');
fprintf(FID, ' & \\multicolumn{1}{c}{ Mean ($\\mu_{e}$)} & \\multicolumn{1}{c}{ Standard Deviation ($\\sigma_{e}$)} & \\multicolumn{1}{c}{ Population } \\\\ \\cline{2-2} \\cline{3-3} \\cline{4-4} \\\\  \n');

fprintf(FID, '%s & %2.2f  & %2.2f  & %2.0f  \\\\[-0.1cm] \n', 'Neighborhood 1' , schools_distrib(1,:)   ); 
fprintf(FID, '%s & (%2.3f)  & (%2.3f)  & %s  \\\\[0.3cm] \n', '' , schools_distrib_se(1,1) , schools_distrib_se(1,2) , ''   ); 
fprintf(FID, '%s & %2.2f  & %2.2f  & %2.0f  \\\\[-0.1cm] \n', 'Neighborhood 2' , schools_distrib(2,:)   ); 
fprintf(FID, '%s & (%2.3f)  & (%2.3f)  & %s  \\\\[0.3cm] \n', '' , schools_distrib_se(2,1) , schools_distrib_se(2,2) , ''   ); 
fprintf(FID, '%s & %2.2f  & %2.2f  & %2.0f  \\\\[-0.1cm] \n', 'Neighborhood 3' , schools_distrib(3,:)   ); 
fprintf(FID, '%s & (%2.3f)  & (%2.3f)  & %s  \\\\[0.3cm] \n', '' , schools_distrib_se(3,1) , schools_distrib_se(3,2) , ''   ); 
fprintf(FID, '%s & %2.2f  & %2.2f  & %2.0f  \\\\[-0.1cm] \n', 'Neighborhood 4' , schools_distrib(4,:)   ); 
fprintf(FID, '%s & (%2.3f)  & (%2.3f)  & %s  \\\\[0.3cm] \n', '' , schools_distrib_se(4,1) , schools_distrib_se(4,2) , ''   ); 
fprintf(FID, '  \\hline \n');
fprintf(FID, '\\end{tabular}\n');
fclose(FID);

cd(fp.matlab)


end
